<?php
Route::prefix('v3')->group(function (){
//Route::prefix('v2')->group(function(){
    //微信分享
    Route::get('/api/jssdk', 'HomeController@jssdk');

    //手机号注册
    Route::post('/api/user/register','UserController@mobileRegister');
    //手机号密码和验证码登陆
    Route::post('/api/user/login','UserController@mobileLogin');
    //获取微信access_token值
    Route::any('/api/user/accessToken','UserController@wxGetToken');
    //获取unionid值
    Route::any('/api/user/unionid','UserController@getWeixinUnionid');
    //微信注册
    Route::post('/api/user/wxRegister','UserController@wxLogin');
    //发送验证码
    Route::post('/api/sms/send', 'UserController@sendSms');



    //轮播图与公告
    Route::any('/api/home/index','HomeController@index');
    //分享
    Route::any('/api/share/info','HomeController@share');
    //清明分享
    Route::any('/api/share/qingming','HomeController@qingming');
    //首页弹窗
    Route::any('/api/home/dialog','HomeController@popups');

    //导航
    Route::any('/api/home/nav','HomeController@nav');
    //福利活动
    Route::any('/api/activity/all','ActivityController@activityAllList');
    //新闻资讯
    Route::any('/api/news/list','ActivityController@newsInformationList');
    //活动详情
    Route::any('/api/activity/detail/{id}','ActivityController@activityDetail');
    //新闻资讯详情
    Route::any('/api/new/detail/{id}','ActivityController@newDetail');
    //今日油价
    Route::any('/api/new/oilPrice','ActivityController@todayOilPrice');


    //油卡直充
    Route::any('/api/oil/meal','RechargeController@oilRechargeMeal');
    //油卡充值套餐
    Route::any('/api/oil/meals','RechargeController@rechargeMeal');
    //充值明细
    Route::any('/api/oil/detail','RechargeController@rechargeDetail');

    //话费直冲
    Route::any('/api/mobile/meal','RechargeController@mobileRechargeMeal');
    //话费套餐
    Route::any('/api/mobile/meals','RechargeController@mobileRecharges');
    //计算运费并返回油卡信息
    ROute::any('/api/recharge/express','OilCardController@countExpress');

    //商品分类
    Route::any('/api/shop/nav','GoodsController@goodsClassList');
    //精选商品和热门商品
    Route::any('/api/shop/selected','GoodsController@goodsSelectedList');
    //商品列表
    Route::any('/api/shop/list','GoodsController@goodsList');
    //商品详情
    Route::any('/api/shop/detail/{id}','GoodsController@goodsDetailById');

    //奖品列表
    Route::any('/api/qm/list','FestivalController@prizeList');

    //常见问题
    Route::get('/api/qa', 'ArticleController@category');
    //问题详情
    Route::get('/api/qa/{id}', 'ArticleController@article');
    //更新
    Route::any('/api/app/control','AppController@control');
    //抽奖剩余次数和获奖名单
    Route::any('/api/qm/roll','FestivalController@winUserList');

    /**
     * 五一
     */
    Route::get("/api/labour/end",'LabourController@isEnd');

    /**
     * 分享活动
     */
    //活动状态
    Route::get('/api/share/status','ShareController@teamStatus');

    /**
     * 今日头条
     */
    Route::get('/api/jrtt','JrttController@jrttApi');
    //全国城市
    Route::get('/api/china/city','AddressController@chinaCity');
    //发现页
    Route::get('/api/discover','HomeController@discover');
});

Route::prefix('v2')->middleware('api.sign')->group(function(){
    //个人中心
    Route::any('/api/user/info','UserController@userInfo');
    //绑定电话
    Route::post('/api/user/changeMobile','UserController@changeMobile');
    //修改密码
    Route::any('/api/user/changePassword','UserController@mobileFindPassWord');
    //修改头像
    Route::post('/api/user/changeAvatar','UserController@changeAvatar');
    //修改昵称
    Route::post('/api/user/changeNickname','UserController@changeNickname');
    //绑定油卡
    Route::post('/api/oil/bindOil','OilCardController@bindOilCard');
    //我的油卡
    Route::any('/api/user/oilCard','UserController@userOilCardList');
    //油卡解除绑定
    Route::any('/api/oil/removeBind','UserController@userOilCardDelete');
    //我的优惠券
    Route::any('/api/user/coupon','UserController@userCouponList');
    //意见反馈
    Route::post('/api/user/feedback','UserController@userFeedBack');
    //我的车辆信息
    Route::any('/api/car/user','UserController@userCar');
    //添加车辆
    Route::post('/api/car/add','UserController@userCarAdd');
    //删除车辆
    Route::post('/api/car/delete','UserController@userCarDelete');
    //违章查询
    Route::post('/api/car/lawbreaking','UserController@carLawbreaking');

    //我的油卡
    Route::any('/api/oil/myOil','UserController@userOilCardList');
    //可用优惠券
    Route::any('/api/oil/usableCoupon','RechargeController@usableCoupon');

    //充值下单并支付
    Route::post('/api/oil/oilOrder','RechargeController@rechargeOrderAndPay');
    //充值再次支付
    Route::any('/api/oil/recharge/pay','RechargeController@rechargeOrderAgainPay');

    //可用优惠券总数
    Route::any('/api/coupon/count','RechargeController@userCoupons');


    //充值订单
    Route::any('/api/order/rechargeOrder','RechargeController@rechargeOrderList');
    //充值订单详情
    Route::any('/api/order/rechargeOrderDetail','RechargeController@rechargeOrderDetail');

    //新增收货地址
    Route::post('/api/address/add','AddressController@addressAdd');
    //编辑收货地址
    Route::post('/api/address/edit','AddressController@addressEdit');
    //删除收货地址
    Route::post('/api/address/del','AddressController@addressDel');
    //设置默认收货地址
    Route::post('/api/address/set','AddressController@addressSetDefault');
    //查询默认收货地址
    Route::get('/api/address/selected','AddressController@addressSelected');
    //收货地址列表
    Route::get('/api/address/list','AddressController@addressList');

    //商城创建订单
    Route::post('/api/shop/createOrder','ShopOrderController@createShopOrder');
    //商城订单再次支付
    Route::post('/api/shop/orderPay','ShopOrderController@shopOrderPay');
    //取消订单
    Route::any('/api/shop/close','ShopOrderController@shopOrderClose');
    //删除订单
    Route::any('/api/shop/delete','ShopOrderController@shopOrderDelete');
    //确认收货
    Route::any('/api/shop/finish','ShopOrderController@shopOrderFinish');

    //商城订单列表
    Route::any('/api/shop/orderList','ShopOrderController@shopOrderList');
    //商城订单
    Route::any('/api/shop/orderDetail','ShopOrderController@shopOrderDetail');
    //充值订单列表
    Route::any('/api/recharge/orderList','RechargeController@rechargeOrderList');
    //充值订单详情
    Route::any('/api/recharge/orderDetail','RechargeController@rechargeOrderDetail');
    //取消充值订单
    Route::any('/api/recharge/close','RechargeController@rechargeOrderClose');

    /**
     * 清明活动
     */
    //抽奖
    //Route::any('/api/qm/draw','FestivalController@probability');
    //我的邀请
    Route::any('/api/qm/invite','FestivalController@userInviteList');
    //我的奖品
    Route::any('/api/qm/prize','FestivalController@userPrize');

    //领取油卡
    Route::post('/api/recharge/getOilCard','OilCardController@newUserGetOilCard');

    /**
     * 五一活动
     */
    //领取奖励
    Route::post('/api/labour/exchange','LabourController@activityExchange');
    //累计金额
    Route::get('/api/labour/amount','LabourController@accumulateAmount');


    /**
     * 邀请好友
     */
    //新人专享
    Route::get('/api/share/new','ShareController@NewUserGetCoupon');
    //发起开团
    Route::get('/api/team/start','ShareController@startTeam');
    //邀请好友列表
    Route::get('/api/team/list','ShareController@teamMemberList');
    //领取活动奖励
    Route::get('/api/share/get','ShareController@getActivityAward');
});



